<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    // var arr = [1,2,3,4];
    // for(var i=0;i<arr.length;i++){
    //     console.log(arr[i]*arr[i]);
    // }


    let arr = [1,2,3,4];
    arr.forEach(x=>{
        console.log(x*x);
    });


</script>



</body>
</html>